﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GCF_2__coderbyte_
{
    public class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine(GCF(477, 999));
            Console.ReadLine();
        }

        public static int GCF(int a, int b)
        {
            int start; if (a > b) start = b; else start = a;
            for (int i = start; i >= 1; i--)
            {
                if ((a % i == 0) && (b % i == 0))
                {
                    return i;
                }
            }
            return 1;
        }
    }
}